<template>
  <div>
    <!-- <h1>个人主页</h1> -->
    <van-cell style="margin-bottom: 10px" is-link to="/compilation">
      <!-- 使用 title 插槽来自定义标题 -->
      <template #title>
        <div class="cell">
          <img
            style="width: 70px; height: 70px; vertical-align: middle"
            :src="url_img"
            alt=""
          />
          <span style="margin-left: 5px">我</span>
          <!-- <span class="custom-title">单元格</span> -->
        </div>
      </template>
    </van-cell>
    <van-cell
      style="margin-bottom: 10px"
      icon="orders-o"
      title="课程"
      is-link
      to="/index/course"
    />
    <van-cell s icon="orders-o" title="周报" is-link to="/weekly" />
    <van-cell s icon="orders-o" title="考勤" is-link to="index" />
    <van-cell s icon="orders-o" title="作业" is-link to="index" />
    <van-cell s icon="orders-o" title="简历" is-link to="/index/resume" />
    <!-- <van-cell s icon="orders-o" title="路由跳转" is-link to="index" />
    <van-cell s icon="orders-o" title="路由跳转" is-link to="index" /> -->
  </div>
</template>
<script>
export default {
  data() {
    return {
      url_img: "",
      list: [
        {
          icon: "",
        },
      ],
    };
  },
  mounted() {
    this.userId = localStorage.getItem("userId");
    this.axios({
      url: "http://localhost:3000/query_data",
      method: "post",
      data: {
        userID: this.userId,
      },
    }).then((res) => {
      this.url_img = res.data[0].head_img;
    });
  },
};
</script>

<style  scoped>
/deep/ .van-cell {
  align-items: center;
  text-align: left;
  box-shadow: 1px 1px #fafafa;
}
img {
  border-radius: 50%;
}
</style>